package com.stable.model;

import com.stable.spider.eastmoney.EastMoneySpider;
import com.stable.spider.ths.XLSData;
import com.stable.vo.BonusFinancing;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Font;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

//PE三阶段估值模型变身
public class PB3change {

    public static void PB3changeWriteXls(String code, HSSFWorkbook workbook, List<XLSData> benefitList, List<XLSData> cashList, List<XLSData> debtList, List<XLSData> mainList) {
        HSSFSheet sheet = workbook.createSheet("PB三阶段估值模型变身");// 创建工作表(Sheet)
        List nullList = Arrays.asList();

        HSSFUtil.row(workbook, sheet, 0, code + ":报告参数", "科目\\时间", benefitList);
        HSSFUtil.row(workbook, sheet, 1, "净利润:NI", "净利润(元)", mainList);

        HSSFUtil.rowFormula(workbook, sheet, 2, "净利润：亿", "CS2/100000000", benefitList, "0.00");

        EastMoneySpider eastMoneySpider = new EastMoneySpider();
        Map<String, BonusFinancing> bfMap = eastMoneySpider.getBonusFinancing(code).stream().collect(Collectors.toMap(BonusFinancing::getSj, bf -> bf, (oldBf, newBf) -> newBf));
        benefitList.stream().filter(xlsData -> StringUtils.equals(xlsData.getKey(), "科目\\时间")).forEach(xlsData -> {
            HSSFRow row4 = sheet.createRow(4);
            HSSFUtil.rowColumn(workbook, row4, 0, "分红明细", Font.COLOR_NORMAL);
            if (0 != xlsData.getYData1()) {
                HSSFUtil.rowColumn(workbook, row4, 1, bfMap.get(new Double(xlsData.getYData1()).intValue() +"") == null ? "0" : bfMap.get(new Double(xlsData.getYData1()).intValue() +"").getMgsy(), Font.COLOR_NORMAL);
            }
            if (0 != xlsData.getYData2()) {
                HSSFUtil.rowColumn(workbook, row4, 2, bfMap.get(new Double(xlsData.getYData2()).intValue() +"") == null ? "0" : bfMap.get(new Double(xlsData.getYData2()).intValue() +"").getMgsy(), Font.COLOR_NORMAL);
            }
            if (0 != xlsData.getYData3()) {
                HSSFUtil.rowColumn(workbook, row4, 3, bfMap.get(new Double(xlsData.getYData3()).intValue() +"") == null ? "0" : bfMap.get(new Double(xlsData.getYData3()).intValue() +"").getMgsy(), Font.COLOR_NORMAL);
            }
            if (0 != xlsData.getYData4()) {
                HSSFUtil.rowColumn(workbook, row4, 4, bfMap.get(new Double(xlsData.getYData4()).intValue() +"") == null ? "0" : bfMap.get(new Double(xlsData.getYData4()).intValue() +"").getMgsy(), Font.COLOR_NORMAL);
            }
            if (0 != xlsData.getYData5()) {
                HSSFUtil.rowColumn(workbook, row4, 5, bfMap.get(new Double(xlsData.getYData5()).intValue() +"") == null ? "0" : bfMap.get(new Double(xlsData.getYData5()).intValue() +"").getMgsy(), Font.COLOR_NORMAL);
            }
            if (0 != xlsData.getYData6()) {
                HSSFUtil.rowColumn(workbook, row4, 6, bfMap.get(new Double(xlsData.getYData6()).intValue() +"") == null ? "0" : bfMap.get(new Double(xlsData.getYData6()).intValue() +"").getMgsy(), Font.COLOR_NORMAL);
            }
        });

        HSSFRow row5 = sheet.createRow(5);
        HSSFUtil.rowColumn(workbook, row5, 0, "分红：亿", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row5, 1, "B5/10000", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row5, 2, "C5/10000", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row5, 3, "D5/10000", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row5, 4, "E5/10000", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row5, 5, "F5/10000", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row5, 6, "G5/10000", Font.COLOR_NORMAL, "0.00");


        HSSFRow row6 = sheet.createRow(6);
        HSSFUtil.rowColumn(workbook, row6, 0, "分红率", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row6, 1, "B6/B3", Font.COLOR_NORMAL, "0.00%");
        HSSFUtil.rowColumnFormula(workbook, row6, 2, "C6/C3", Font.COLOR_NORMAL, "0.00%");
        HSSFUtil.rowColumnFormula(workbook, row6, 3, "D6/D3", Font.COLOR_NORMAL, "0.00%");
        HSSFUtil.rowColumnFormula(workbook, row6, 4, "E6/E3", Font.COLOR_NORMAL, "0.00%");
        HSSFUtil.rowColumnFormula(workbook, row6, 5, "F6/F3", Font.COLOR_NORMAL, "0.00%");
        HSSFUtil.rowColumnFormula(workbook, row6, 6, "G6/G3", Font.COLOR_NORMAL, "0.00%");

        HSSFUtil.row(workbook, sheet, 7, "加权净资产收益率", "净资产收益率", mainList);
        HSSFUtil.row(workbook, sheet, 8, "净利润同比增长率", "净利润同比增长率", mainList);
        HSSFUtil.row(workbook, sheet, 9, "扣非净利润同比增长率", "扣非净利润同比增长率", mainList);



        HSSFRow row11 = sheet.createRow(11);
        HSSFUtil.rowColumn(workbook, row11, 0, "平均值", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row11, 1, "利润增长率", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row11, 2, "归母净利润", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row11, 3, "分红率", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row11, 4, "ROE", Font.COLOR_NORMAL);

        HSSFRow row12 = sheet.createRow(12);
        HSSFUtil.rowColumn(workbook, row12, 0, "5年平均", Font.COLOR_RED);
        HSSFUtil.rowColumnFormula(workbook, row12, 1, "AVERAGE(B9:F9)/100", Font.COLOR_RED, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row12, 3, "AVERAGE(C7:G7)", Font.COLOR_RED, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row12, 4, "AVERAGE(B8:F8)/100", Font.COLOR_RED, "0.0%");


        HSSFRow row13 = sheet.createRow(13);
        HSSFUtil.rowColumn(workbook, row13, 0, "10年平均", Font.COLOR_RED);
        HSSFUtil.rowColumnFormula(workbook, row13, 1, "AVERAGE(B9:K9)/100", Font.COLOR_RED, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row13, 3, "AVERAGE(C7:G7)", Font.COLOR_RED, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row13, 4, "AVERAGE(B8:K8)/100", Font.COLOR_RED, "0.0%");



        HSSFRow row15 = sheet.createRow(15);
        HSSFUtil.rowColumn(workbook, row15, 0, "1、股东价值-PB三阶段估值模型（默认过去5年）", Font.COLOR_NORMAL);

        HSSFRow row16 = sheet.createRow(16);
        HSSFUtil.rowColumn(workbook, row16, 0, "计算模型", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 1, "净资产", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 2, "ROE", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 3, "分红率", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 4, "净资产增速", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 5, "归母净利润", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 6, "净利润增速", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 7, "股东价值率", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 8, "股东价值", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 9, "折现率", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 10, "折现系数", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 11, "股东价值折现", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 12, "股东价值折现：累计求和", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row16, 13, "PB估值 PE估值", Font.COLOR_NORMAL);

        HSSFRow row17 = sheet.createRow(17);
        HSSFUtil.rowColumn(workbook, row17, 0, "今年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row17, 1, "1", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row17, 2, "B8/100", Font.COLOR_NORMAL, "0.0%");
        //HSSFUtil.rowColumn(workbook, row17, 9, "10%", Font.COLOR_RED);
        //rowColumn(workbook, row17, 9, "1-10年", Font.COLOR_NORMAL);
        //rowColumnFormula(workbook, row17, 10, "(1+B18)*F18/(G18-B18)-((1+B18)^11)*F18/(G18-B18)/(1+G18)^10", Font.COLOR_RED, "0.0");


        HSSFRow row18 = sheet.createRow(18);
        HSSFUtil.rowColumn(workbook, row18, 0, "未来10年", Font.COLOR_RED);
        HSSFUtil.rowColumnFormula(workbook, row18, 2, "AVERAGE(B8:F8)/100", Font.COLOR_RED, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row18, 3, "AVERAGE(C7:G7)", Font.COLOR_RED, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row18, 7, "D19+(1-D19)*C19", Font.COLOR_RED, "0.0%");
        HSSFUtil.rowColumn(workbook, row18, 9, "10%", Font.COLOR_RED);
        HSSFUtil.rowColumn(workbook, row18, 13, "1-10年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row18, 14, "SUM(L20:L29)", Font.COLOR_RED, "0.00");

        HSSFRow row19 = sheet.createRow(19);
        HSSFUtil.rowColumn(workbook, row19, 0, "第1年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row19, 1, "B18*(1+E20)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row19, 2, "C$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row19, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row19, 4, "C20*(1-D20)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row19, 5, "B20*C20", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row19, 6, "E20", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row19, 7, "D20+(1-D20)*C20", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row19, 8, "F20*H20", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row19, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row19, 10, "1/(1+J20)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row19, 11, "I20*K20", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row19, 12, "SUM(L$20:L20)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumn(workbook, row19, 13, "11-20年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row19, 14, "SUM(L31:L40)", Font.COLOR_RED, "0.00");

        HSSFRow row20 = sheet.createRow(20);
        HSSFUtil.rowColumn(workbook, row20, 0, "第2年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row20, 1, "B20*(1+E21)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row20, 2, "C$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row20, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row20, 4, "C21*(1-D21)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row20, 5, "B21*C21", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row20, 6, "E21", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row20, 7, "D21+(1-D21)*C21", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row20, 8, "F21*H21", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row20, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row20, 10, "K20/(1+J21)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row20, 11, "I21*K21", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row20, 12, "SUM(L$20:L21)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumn(workbook, row20, 13, "20年后", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row20, 14, "I42/(J42-E42)*K40", Font.COLOR_RED, "0.00");

        HSSFRow row21 = sheet.createRow(21);
        HSSFUtil.rowColumn(workbook, row21, 0, "第3年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row21, 1, "B21*(1+E22)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row21, 2, "C$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row21, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row21, 4, "C22*(1-D22)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row21, 5, "B22*C22", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row21, 6, "E22", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row21, 7, "D22+(1-D22)*C22", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row21, 8, "F22*H22", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row21, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row21, 10, "K21/(1+J22)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row21, 11, "I22*K22", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row21, 12, "SUM(L$20:L22)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumn(workbook, row21, 13, "利润价值合计", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row21, 14, "O19+O20+O21", Font.COLOR_RED, "0.00");

        HSSFRow row22 = sheet.createRow(22);
        HSSFUtil.rowColumn(workbook, row22, 0, "第4年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row22, 1, "B22*(1+E23)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row22, 2, "C$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row22, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row22, 4, "C23*(1-D23)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row22, 5, "B23*C23", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row22, 6, "E23", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row22, 7, "D23+(1-D23)*C23", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row22, 8, "F23*H23", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row22, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row22, 10, "K22/(1+J23)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row22, 11, "I23*K23", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row22, 12, "SUM(L$20:L23)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumn(workbook, row22, 13, "当前清算价值", Font.COLOR_NORMAL);
        HSSFUtil.rowColumn(workbook, row22, 14, "1", Font.COLOR_NORMAL);

        HSSFRow row23 = sheet.createRow(23);
        HSSFUtil.rowColumn(workbook, row23, 0, "第5年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row23, 1, "B23*(1+E24)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row23, 2, "C$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row23, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row23, 4, "C24*(1-D24)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row23, 5, "B24*C24", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row23, 6, "E24", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row23, 7, "D24+(1-D24)*C24", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row23, 8, "F24*H24", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row23, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row23, 10, "K23/(1+J24)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row23, 11, "I24*K24", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row23, 12, "SUM(L$20:L24)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumn(workbook, row23, 13, "PB估值", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row23, 14, "O23+O22", Font.COLOR_NORMAL, "0.00");

        HSSFRow row24 = sheet.createRow(24);
        HSSFUtil.rowColumn(workbook, row24, 0, "第6年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row24, 1, "B24*(1+E25)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row24, 2, "C$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row24, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row24, 4, "C25*(1-D25)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row24, 5, "B25*C25", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row24, 6, "E25", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row24, 7, "D25+(1-D25)*C25", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row24, 8, "F25*H25", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row24, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row24, 10, "K24/(1+J25)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row24, 11, "I25*K25", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row24, 12, "SUM(L$20:L25)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumn(workbook, row24, 13, "注意：（1）清算价值有可能要打折扣；（2）如果每股净资产是会计虚造的，或者有资产贬值风险，则估值要在此基础上打折扣！", Font.COLOR_RED);


        HSSFRow row25 = sheet.createRow(25);
        HSSFUtil.rowColumn(workbook, row25, 0, "第7年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row25, 1, "B25*(1+E26)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row25, 2, "C$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row25, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row25, 4, "C26*(1-D26)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row25, 5, "B26*C26", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row25, 6, "E26", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row25, 7, "D26+(1-D26)*C26", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row25, 8, "F26*H26", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row25, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row25, 10, "K25/(1+J26)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row25, 11, "I26*K26", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row25, 12, "SUM(L$20:L26)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row26 = sheet.createRow(26);
        HSSFUtil.rowColumn(workbook, row26, 0, "第8年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row26, 1, "B26*(1+E27)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row26, 2, "C$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row26, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row26, 4, "C27*(1-D27)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row26, 5, "B27*C27", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row26, 6, "E27", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row26, 7, "D27+(1-D27)*C27", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row26, 8, "F27*H27", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row26, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row26, 10, "K26/(1+J27)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row26, 11, "I27*K27", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row26, 12, "SUM(L$20:L27)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row27 = sheet.createRow(27);
        HSSFUtil.rowColumn(workbook, row27, 0, "第9年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row27, 1, "B27*(1+E28)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row27, 2, "C$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row27, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row27, 4, "C28*(1-D28)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row27, 5, "B28*C28", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row27, 6, "E28", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row27, 7, "D28+(1-D28)*C28", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row27, 8, "F28*H28", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row27, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row27, 10, "K27/(1+J28)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row27, 11, "I28*K28", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row27, 12, "SUM(L$20:L28)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row28 = sheet.createRow(28);
        HSSFUtil.rowColumn(workbook, row28, 0, "第10年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row28, 1, "B28*(1+E29)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row28, 2, "C$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row28, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row28, 4, "C29*(1-D29)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row28, 5, "B29*C29", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row28, 6, "E29", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row28, 7, "D29+(1-D29)*C29", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row28, 8, "F29*H29", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row28, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row28, 10, "K28/(1+J29)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row28, 11, "I29*K29", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row28, 12, "SUM(L$20:L29)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row29 = sheet.createRow(29);
        HSSFUtil.rowColumn(workbook, row29, 0, "11-20年", Font.COLOR_RED);

        HSSFRow row30 = sheet.createRow(30);
        HSSFUtil.rowColumn(workbook, row30, 0, "第11年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row30, 1, "B29*(1+E31)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row30, 2, "C19-(C19-C41)/10", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row30, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row30, 4, "C31*(1-D31)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row30, 5, "B31*C31", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row30, 6, "F31/F29-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row30, 7, "D31+(1-D31)*C31", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row30, 8, "F31*H31", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row30, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row30, 10, "K29/(1+J31)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row30, 11, "I31*K31", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row30, 12, "SUM(L$20:L31)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumn(workbook, row30, 13, "PE估值", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row30, 14, "O24/C18", Font.COLOR_NORMAL, "0.00");

        HSSFRow row31 = sheet.createRow(31);
        HSSFUtil.rowColumn(workbook, row31, 0, "第12年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row31, 1, "B31*(1+E32)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row31, 2, "C31-(C$19-C$41)/10", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row31, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row31, 4, "C32*(1-D32)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row31, 5, "B32*C32", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row31, 6, "F32/F31-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row31, 7, "D32+(1-D32)*C32", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row31, 8, "F32*H32", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row31, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row31, 10, "K31/(1+J32)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row31, 11, "I32*K32", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row31, 12, "SUM(L$20:L32)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row32 = sheet.createRow(32);
        HSSFUtil.rowColumn(workbook, row32, 0, "第13年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row32, 1, "B32*(1+E33)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row32, 2, "C32-(C$19-C$41)/10", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row32, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row32, 4, "C33*(1-D33)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row32, 5, "B33*C33", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row32, 6, "F33/F32-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row32, 7, "D33+(1-D33)*C33", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row32, 8, "F33*H33", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row32, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row32, 10, "K32/(1+J33)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row32, 11, "I33*K33", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row32, 12, "SUM(L$20:L33)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row33 = sheet.createRow(33);
        HSSFUtil.rowColumn(workbook, row33, 0, "第14年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row33, 1, "B33*(1+E34)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row33, 2, "C33-(C$19-C$41)/10", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row33, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row33, 4, "C34*(1-D34)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row33, 5, "B34*C34", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row33, 6, "F34/F33-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row33, 7, "D34+(1-D34)*C34", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row33, 8, "F34*H34", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row33, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row33, 10, "K33/(1+J34)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row33, 11, "I34*K34", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row33, 12, "SUM(L$20:L34)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row34 = sheet.createRow(34);
        HSSFUtil.rowColumn(workbook, row34, 0, "第15年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row34, 1, "B34*(1+E35)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row34, 2, "C34-(C$19-C$41)/10", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row34, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row34, 4, "C35*(1-D35)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row34, 5, "B35*C35", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row34, 6, "F35/F34-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row34, 7, "D35+(1-D35)*C35", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row34, 8, "F35*H35", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row34, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row34, 10, "K34/(1+J35)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row34, 11, "I35*K35", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row34, 12, "SUM(L$20:L35)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row35 = sheet.createRow(35);
        HSSFUtil.rowColumn(workbook, row35, 0, "第16年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row35, 1, "B35*(1+E36)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row35, 2, "C35-(C$19-C$41)/10", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row35, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row35, 4, "C36*(1-D36)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row35, 5, "B36*C36", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row35, 6, "F36/F35-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row35, 7, "D36+(1-D36)*C36", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row35, 8, "F36*H36", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row35, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row35, 10, "K35/(1+J36)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row35, 11, "I36*K36", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row35, 12, "SUM(L$20:L36)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row36 = sheet.createRow(36);
        HSSFUtil.rowColumn(workbook, row36, 0, "第17年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row36, 1, "B36*(1+E37)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row36, 2, "C36-(C$19-C$41)/10", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row36, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row36, 4, "C37*(1-D37)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row36, 5, "B37*C37", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row36, 6, "F37/F36-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row36, 7, "D37+(1-D37)*C37", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row36, 8, "F37*H37", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row36, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row36, 10, "K36/(1+J37)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row36, 11, "I37*K37", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row36, 12, "SUM(L$20:L37)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row37 = sheet.createRow(37);
        HSSFUtil.rowColumn(workbook, row37, 0, "第18年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row37, 1, "B37*(1+E38)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row37, 2, "C37-(C$19-C$41)/10", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row37, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row37, 4, "C38*(1-D38)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row37, 5, "B38*C38", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row37, 6, "F38/F37-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row37, 7, "D38+(1-D38)*C38", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row37, 8, "F38*H38", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row37, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row37, 10, "K37/(1+J38)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row37, 11, "I38*K38", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row37, 12, "SUM(L$20:L38)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row38 = sheet.createRow(38);
        HSSFUtil.rowColumn(workbook, row38, 0, "第19年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row38, 1, "B38*(1+E39)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row38, 2, "C38-(C$19-C$41)/10", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row38, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row38, 4, "C39*(1-D39)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row38, 5, "B39*C39", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row38, 6, "F39/F38-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row38, 7, "D39+(1-D39)*C39", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row38, 8, "F39*H39", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row38, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row38, 10, "K38/(1+J39)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row38, 11, "I39*K39", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row38, 12, "SUM(L$20:L39)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row39 = sheet.createRow(39);
        HSSFUtil.rowColumn(workbook, row39, 0, "第20年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row39, 1, "B39*(1+E40)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row39, 2, "C39-(C$19-C$41)/10", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row39, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row39, 4, "C40*(1-D40)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row39, 5, "B40*C40", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row39, 6, "F40/F39-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row39, 7, "D40+(1-D40)*C40", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row39, 8, "F40*H40", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row39, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row39, 10, "K39/(1+J40)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row39, 11, "I40*K40", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row39, 12, "SUM(L$20:L40)", Font.COLOR_NORMAL, "0.00");

        HSSFRow row40 = sheet.createRow(40);
        HSSFUtil.rowColumn(workbook, row40, 0, "20年后", Font.COLOR_RED);
        HSSFUtil.rowColumn(workbook, row40, 2, "5%", Font.COLOR_RED);

        HSSFRow row41 = sheet.createRow(41);
        HSSFUtil.rowColumn(workbook, row41, 0, "第21年", Font.COLOR_NORMAL);
        HSSFUtil.rowColumnFormula(workbook, row41, 1, "B40*(1+E42)", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row41, 2, "C41", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row41, 3, "D$19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row41, 4, "C42*(1-D42)", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row41, 5, "B42*C42", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row41, 6, "F42/F40-1", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row41, 7, "D42+(1-D42)*C42", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row41, 8, "F42*H42", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row41, 9, "J19", Font.COLOR_NORMAL, "0.0%");
        HSSFUtil.rowColumnFormula(workbook, row41, 10, "K40/(1+J42)", Font.COLOR_NORMAL, "0.000");
        HSSFUtil.rowColumnFormula(workbook, row41, 11, "I42*K42", Font.COLOR_NORMAL, "0.00");
        HSSFUtil.rowColumnFormula(workbook, row41, 12, "SUM(L$20:L42)", Font.COLOR_NORMAL, "0.00");
    }
}
